package com.heo.pojo;

import com.heo.util.ByteHelper;
import com.heo.util.Utils;

public class LoginInfoEntity  extends BaseEntity{

	private static final long serialVersionUID = 1L;
	private String imei;
	private String iccid;
	private String manufactorVersion; //
	private String version;
	
	public LoginInfoEntity(String bodyHex) {
		imei = ByteHelper.hexStringToString(bodyHex.substring(0, 30));
		iccid = ByteHelper.hexStringToString(bodyHex.substring(30, 70));
		manufactorVersion = ByteHelper.hexStringToString(bodyHex.substring(70, 72));
		
		String[] versions = new String[] {Utils.getStr(ByteHelper.hex16ToInt(bodyHex.substring(72, 76))), Utils.getStr(ByteHelper.hex16ToInt(bodyHex.substring(76, 80))), Utils.getStr(ByteHelper.hex16ToInt(bodyHex.substring(80, 84))), Utils.getStr(ByteHelper.hex16ToInt(bodyHex.substring(84, 88)))};
		version = String.join(".", versions);
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getIccid() {
		return iccid;
	}

	public void setIccid(String iccid) {
		this.iccid = iccid;
	}

	public String getManufactorVersion() {
		return manufactorVersion;
	}

	public void setManufactorVersion(String manufactorVersion) {
		this.manufactorVersion = manufactorVersion;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}
}
